package cn.levi.sensitive.component;

import cn.hutool.extra.spring.SpringUtil;
import cn.levi.sensitive.configuration.SensitiveProperties;
import java.util.List;
import java.util.Set;
import java.util.function.Function;

/**
 * 敏感词工厂定义
 *
 * @author lei
 * @since 2025/2/18
 */
@FunctionalInterface
public interface SensitiveFactory {


	/**
	 * 获取敏感词集合
	 *
	 * @return
	 */
	public Set<String> getSensitiveWords();

	/**
	 * 是否开启敏感词检测
	 */
	public default boolean isEnable(){
		//获取配置
		SensitiveProperties sensitiveProperties = SpringUtil.getBean(SensitiveProperties.class);
		return sensitiveProperties.isEnable();
	}

}
